#coding:utf-8
from bs4 import BeautifulSoup#从bs4 pack package中导入BeautifulSoup类
import requests#导入处理HTTP请求的库requests
html_doc=requests.get('http://tieba.baidu.com/p/4981976332').content
soup=BeautifulSoup(html_doc)#创建一个BeautifulSoup对象Soup
img_urls=soup.find_all('img')#获取soup对象中的所有img元素
i=0
for img in img_urls:遍历img_irls中src属性对应的值
    print img.get('src')
    if i==5:
        break
    i=i+1